package com.bo.mybatis.controller;

import com.bo.mybatis.model.StudentInfo;
import com.bo.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/mybatis")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/getList")
    public List<StudentInfo> getList(){
        return userService.getList();
    }
    @RequestMapping("/getListRun")
    public void getListRun(){
        List<StudentInfo> list = userService.getList();
        for(StudentInfo userInfo : list){
            System.out.println(userInfo);
        }
    }
}









